import 'package:baselib/base/base_responce.dart';
import 'package:baselib/util/common_apiservice.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/model/base_info.dart';
import 'package:flutter_app/util/urls.dart';
import 'package:get/get.dart';
import 'package:toast/toast.dart';
class OrderController extends GetxController{

  var baseInfo=BaseInfo().obs;
  var carType=Car_type().obs;
  var isSelectWeiban=false.obs;
  static OrderController get to => Get.find();
  ///获取下单数据
  Future<void> getOrderDatas(BuildContext context) async{

    BaseResponce responce = await CommonApiService.requestGet(
      Get.context,
      url: Urls.base_info,
    );
    if(responce.code==200){
      BaseInfo data=BaseInfo.fromJson(responce.data);
      baseInfo.value=data;
    }else{
      Toast.show(responce.message, context, duration: Toast.LENGTH_LONG, gravity:  Toast.TOP,backgroundColor:Colors.red);
    }
  }
}